#pragma once
#include "base/core/singleton.h"
#include "base/core/random.h"
#include "Common/TableData/TreasureAdventureCfg.h"
#include "Common/TreasureDefine.h"

class TreasureMgr : public ManualSingleton< TreasureMgr >
{
	friend class ManualSingleton < TreasureMgr > ;
	typedef std::vector<TreasureAdventureCfgInfo> TREASURE_CFG_VEC;
	//				 < quality,   vec>
	typedef std::map < int32_t, TREASURE_CFG_VEC> TREASURE_CFG_MAP;
public:
	TreasureMgr() {};
	~TreasureMgr() {};

public:
	bool		Init();
	bool		UnInit();
	void		InitConfig();
	const TreasureAdventureCfgInfo*		RandGame(TreasureQualityEnum quality);
private:
	TREASURE_CFG_MAP	mTreasureCfgMap;
};

#define g_MakeTreasureMgr() (TreasureMgr::Instance())
#define g_GetTreasureMgr() (TreasureMgr::GetInstance())
#define g_DelTreasureMgr() (TreasureMgr::Destroy())